import {createRouter, createWebHistory} from 'vue-router'
import HomeView from '../views/HomeView.vue'
import LoginView from "../views/LoginView.vue";

const routes = [
    {
        path: '/',
        component: LoginView,

    },
    {
        path: '/reg',
        component: () => import('../views/RegView')
    },
    {
        path: '/login',
        component: () => import('../views/LoginView')
    },
    {
        path: '/select',
        component: () => import('../views/SelectView')
    },
    {
        path: '/detail',
        component: () => import('../views/DetailView')
    },

    {
        path: '/home',
        component: ()=>import('../views/HomeView'),
        children:[
            {path:'capital', component : ()=>import('../views/home/CapitalView')},
            {path:'data',component:()=>import('../views/home/DataView'),
               children: [
                   {path:'clientclassify',component:()=>import('../views/home/data/kehu/ClientClassifyView')},
                   {path:'clientlevel',component:()=>import('../views/home/data/kehu/ClientLevelView')},
                   {path:'clientmanagement',component:()=>import('../views/home/data/kehu/ClientManagementView')},
                   {path:'clienttag',component:()=>import('../views/home/data/kehu/ClientTagView')},
                   {path: 'product', component: () => import('../views/home/data/shangPin/ProductView'),
                       children:[
                           {path: 'addProduct', component: () => import('../views/home/data/shangPin/product/AddProductView')},
                           {path: 'detailProduct', component: () => import('../views/home/data/shangPin/product/DetailProductView')}
                       ]},
                   {path: 'productComb', component: () => import('../views/home/data/shangPin/ProductCombView'),
                       children:[
                           {path: 'addProductComb', component: () => import('../views/home/data/shangPin/productComb/DetailProductCombView')},
                           {path: 'detailProductComb', component: () => import('../views/home/data/shangPin/productComb/AddProductCombView')}
                       ]},
                   {path: 'productCate', component: () => import('../views/home/data/shangPin/ProductCateView')},
                   {path: 'productType', component: () => import('../views/home/data/shangPin/ProductTypeView')},
                   {path: 'attribute', component: () => import('../views/home/data/shangPin/AttributeView'),
                       children:[
                           {path: 'addAttribute', component: () => import('../views/home/data/shangPin/productComb/AddProductCombView')}
                       ]},
                   {path: 'unit', component: () => import('../views/home/data/shangPin/UnitView')},
                   {path: 'gysclassify', component: () => import('../views/home/data/gys/GysClassifyView')},
                   {path: 'gysmanagement', component: () => import('../views/home/data/gys/GysManagementView')},
               ]
            },
            {path:'inventory',component:()=>import('../views/home/InventoryView')},
            {path:'market',component:()=>import('../views/home/MarketView')},
            {path:'purchase',component:()=>import('../views/home/PurchaseView')},
            {path:'set',component:()=>import('../views/home/SetView'),
                children:[
                    {path:'changPW',component:()=>import('../views/home/set/ChangePWView')},
                    {path:'epi',component:()=>import('../views/home/set/EpiView')},
                    {path:'log',component:()=>import('../views/home/set/LogView')},
                    {path:'message',component:()=>import('../views/home/set/MessageView')},
                    {path:'note',component:()=>import('../views/home/set/NoteView')},
                    {path:'personal',component:()=>import('../views/home/set/PersonalView')},
                    {path:'print',component:()=>import('../views/home/set/PrintView')},
                    {path:'role',component:()=>import('../views/home/set/RoleView')},
                    {path:'staff',component:()=>import('../views/home/set/StaffView')},
                ]
            },
            {path:'statement',component:()=>import('../views/home/StatementView')}
        ]
    },




]

const router = createRouter({
    history: createWebHistory(process.env.BASE_URL),
    routes
})

export default router
